package edu.pablocor.AndNote.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DatabaseOpenHelper extends SQLiteOpenHelper {
	
	String sqlCreateElementosCompras = "CREATE TABLE " + DbConstants.TABLAELEMENTOS + "( " + DbConstants.ID + " INTEGER PRIMARY KEY, " + DbConstants.IDCOMPRA + " INTEGER, " + DbConstants.ELEMENTOCOMPRAS + " TEXT, " + DbConstants.TACHADO + " INTEGER)";
	String sqlCreateListaCompra = "CREATE TABLE " + DbConstants.TABLACOMPRAS + " ( " + DbConstants.ID + " INTEGER PRIMARY KEY, " + DbConstants.NOMBRECOMPRA + " TEXT, " + DbConstants.FECHACOMPRA + " TEXT)";
	String sqlCreateBlocdeNotas = "CREATE TABLE " + DbConstants.TABLANOTAS + " ( " + DbConstants.ID + " INTEGER PRIMARY KEY, " + DbConstants.NOMBRENOTAS + " TEXT, " + DbConstants.FECHANOTAS + " TEXT, " + DbConstants.TEXTONOTAS + " TEXT)";
	String sqlCreateAgenda = "CREATE TABLE " + DbConstants.TABLAAGENDA + " ( " + DbConstants.ID + " INTEGER PRIMARY KEY, " + DbConstants.FECHAAGENDA + " TEXT, " + DbConstants.HORAINICIO + " TEXT, " + DbConstants.HORAFIN + " TEXT, " + DbConstants.ALARMA + " TEXT, " + DbConstants.NOMBREAGENDA + " TEXT, " + DbConstants.TEXTOAGENDA + " TEXT)";
	
	public DatabaseOpenHelper(Context context, String name,
			CursorFactory factory, int version) {
		super(context, name, factory, version);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		Log.d("",sqlCreateElementosCompras);
		Log.d("",sqlCreateListaCompra);
		Log.d("",sqlCreateBlocdeNotas);
		Log.d("",sqlCreateAgenda);
			db.execSQL(sqlCreateElementosCompras);
			db.execSQL(sqlCreateListaCompra);
			db.execSQL(sqlCreateBlocdeNotas);
			db.execSQL(sqlCreateAgenda);
			
			
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub

	}

}
